import json

class Operater_json:

    def __init__(self):
        self.data = self.open_json()

    def open_json(self,filename=None):
        if filename is None:
            with open("test1.json") as fp:
                data = json.load(fp)
        else:
            with open(filename) as fp:
                data =json.load(fp)
        return data

    def read_json(self,id):
        print(self.data[id])
        return self.data[id]


if __name__ == '__main__':

    file = Operater_json()
    file.read_json('login1')
    # with open("test1.json") as fp:
    #     data = json.load(fp)
    #     print(data["login1"])